#include <bits/stdc++.h>

using namespace std;
char a[100];
int sum=0;
int main()
{
    for(int i=0;i<13;i++){
        cin>>a[i];
    }
    sum = (a[0]-'0')*1+(a[2]-'0')*2+(a[3]-'0')*3+(a[4]-'0')*4+(a[6]-'0')*5+(a[7]-'0')*6
    +(a[8]-'0')*7+(a[9]-'0')*8+(a[10]-'0')*9;
    sum %=11;
    if((a[12]-'0')==sum||sum==10&&a[12]=='X')
    {
        cout<<"Right";
    }else{
        for(int i=0;i<12;i++){
            cout<<a[i];
        }
        if(sum==10){
            cout<<'X';
        }else{
            cout<<sum;
        }
    }
    return 0;
}
